import request from '@/utils/request'

/**
 * 创建员工
 */
export function createEmployee(data) {
  return request({
    url: '/employee/create',
    method: 'post',
    data
  })
}

/**
 * 更新员工信息
 */
export function updateEmployee(id, data) {
  return request({
    url: `/employee/${id}`,
    method: 'put',
    data
  })
}

/**
 * 删除员工
 */
export function deleteEmployee(id) {
  return request({
    url: `/employee/${id}`,
    method: 'delete'
  })
}

/**
 * 获取员工详情
 */
export function getEmployeeDetail(id) {
  return request({
    url: `/employee/${id}`,
    method: 'get'
  })
}

/**
 * 查询员工列表（分页）
 */
export function getEmployeeList(params) {
  return request({
    url: '/employee/list',
    method: 'get',
    params
  })
}

/**
 * 获取所有员工列表（不分页）
 */
export function getAllEmployees() {
  return request({
    url: '/employee/all',
    method: 'get'
  })
}

/**
 * 启用/禁用员工
 */
export function toggleEmployeeStatus(id) {
  return request({
    url: `/employee/${id}/toggle-status`,
    method: 'put'
  })
}

/**
 * 重置员工密码
 */
export function resetPassword(id, data) {
  return request({
    url: `/employee/${id}/reset-password`,
    method: 'put',
    data
  })
}

/**
 * 获取员工统计信息
 */
export function getEmployeeStatistics(id) {
  return request({
    url: `/employee/${id}/statistics`,
    method: 'get'
  })
}





